package com.leet.code.simple_array;

import java.util.ArrayList;
import java.util.List;

/**
 * @description:
 * @author: WYG
 * @time: 2020/12/11 9:27
 */

public class PrefixesDivBy5 {
    public List<Boolean> prefixesDivBy5(int[] A) {
        int num=0;
        List<Boolean> ans=new ArrayList<>();
        for(int i = 0; i < A.length; i++){
            num = (num * 2 + A[i]) % 5;
            System.out.print(num);
            if (num % 5 == 0) {
                ans.add(true);
            } else {
                ans.add(false);
            }
        }
        return ans;
    }
}
